

/*
This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only.
It is supposed to be strictly declarative and only uses a subset of QML. If you edit
this file manually, you might introduce QML code that is not supported by Qt Design Studio.
Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files.
*/
import QtQuick 2.15
import QtQuick.Controls 2.15

Button {
    id: control
    width: 60+10+Math.max((text1Show?name1.contentWidth:0),(text2Show?name2.contentWidth:0))
    height: 60
    text: ""

    property string imgpath: imgPATH+"status/button_edit.png"
    property string text1L: "text1"
    property string text2L: "text2"
    property bool text1LShow: true
    property bool text2LShow: true

    background: buttonBackground
    Rectangle{
        id: buttonBackground
        color: "transparent"

        Row{
            spacing: 10
            Image {
                height: 50
                width: 50
                id: name
                source: imgpath

            }
            Column{
                Text {
                    id: name1
                    visible: text1LShow
                    text: qsTr(text1L)
                }
                Text {
                    id: name2
                    visible: text2LShow
                    text: qsTr(text2L)
                }
            }
            Rectangle {
                id: splitLine
                height: parent.height * 0.6
                width: 1
                anchors.verticalCenter: parent.verticalCenter
                anchors.leftMargin: 20
                anchors.rightMargin: 20
            }

        }

    }

    states: [
        State {
            name: "normal"
            when: !control.down

            PropertyChanges {
                target: buttonBackground
                color: "#00000000"
            }
        },
        State {
            name: "down"
            when: control.down

            PropertyChanges {
                target: buttonBackground
                color: "#047eff"
            }

            PropertyChanges {
                target: control
                display: AbstractButton.TextOnly
            }
        }
    ]
}

/*##^##
Designer {
    D{i:0;height:60;width:100}
}
##^##*/

